import requests
from config import RunConfig

def 归档文件编辑(para):
    response = requests.post(
        url=RunConfig.url + "/outcome/archive/update",
        headers=RunConfig.headers,
        json=para,
        verify=False
    )
    return response


def 送审核(para):
    response = requests.post(
        url=RunConfig.url + "/outcome/archive/send/approval",
        headers=RunConfig.headers,
        json=para,
        verify=False
    )
    return response


def 审核(para):
    response = requests.post(
        url=RunConfig.url + "/outcome/archive/approval",
        headers=RunConfig.headers,
        json=para,
        verify=False
    )
    return response


def 重新生成归档文件(para):
    response = requests.post(
        url=RunConfig.url + "/outcome/archive/rebuild/{id}",
        headers=RunConfig.headers,
        json=para,
        verify=False
    )
    return response


def 归档(para):
    response = requests.get(
        url=RunConfig.url + "outcome/archive/{id}",
        headers=RunConfig.headers,
        verify=False
    )
    return response


def 生成归档文件（批量）(para):
    response = requests.get(
        url=RunConfig.url + "outcome/archive/build/{projectId}",
        headers=RunConfig.headers,
        verify=False
    )
    return response


def 归档文件详情(para):
    response = requests.get(
        url=RunConfig.url + "outcome/archive/info/{projectId}",
        headers=RunConfig.headers,
        verify=False
    )
    return response


def 分页查询成果归档(para):
    response = requests.post(
        url=RunConfig.url + "/outcome/archive/page?page=1&perPage=10",
        headers=RunConfig.headers,
        json=para,
        verify=False
    )
    return response
